<template>
  <div class="supervision">
    <div class="total">
      <el-row :gutter="20">
        <el-col :span="6">
          <img src="../../assets/images/protect.png" alt="" />
          <span style="font-size: 1rem">{{ superObj.all.name }}</span>
        </el-col>
        <el-col :span="6">
          <div class="fs-sm">有效率</div>
          <p class="bold-blue">{{ superObj.all.effective }}%</p>
        </el-col>
        <el-col :span="6">
          <div class="fs-sm">环比</div>
          <p class="bold-blue">
            <i
              class="el-icon-caret-top"
              style="color: #ff3535"
              v-if="superObj.all.ringRatio.indexOf('-') == -1"
            ></i>
            <i class="el-icon-caret-bottom" style="color:#00b62c" v-else></i>
            {{ superObj.all.ringRatio }}
          </p>
        </el-col>
        <el-col :span="6">
          <div class="fs-sm">告警设备(台)</div>
          <p class="bold-blue">{{ superObj.all.num }}</p>
        </el-col>
      </el-row>
    </div>
    <div class="details" v-if="superObj.typeList.length>0">
      <CycleComponent
        :time="superObj.typeList.length < 3 ? 0 : 10"
        :paused="superObj.typeList.length < 3"
      >
        <el-row
          :gutter="20"
          class="sp-flex"
          v-for="(item, index) in superObj.typeList"
        >
          <el-col :span="6">
            <span style="font-size: 1rem">{{ item.name }}</span>
          </el-col>
          <el-col :span="6">
            <div class="fs-sm">有效率</div>
            <p class="bold-blue">{{ item.effective }}%</p>
          </el-col>
          <el-col :span="6">
            <div class="fs-sm">环比</div>
            <p class="bold-blue">
              <i
                class="el-icon-caret-top"
                style="color: #ff3535"
                v-if="superObj.all.ringRatio.indexOf('-') == -1"
              ></i>
              <i
                class="el-icon-caret-bottom"
                style="color:#00b62c"
                v-else
              ></i>
              {{ item.ringRatio }}
            </p>
          </el-col>
          <el-col :span="6">
            <div class="fs-sm">告警设备(台)</div>
            <p class="bold-blue">{{ item.num }}</p>
          </el-col>
        </el-row>
      </CycleComponent>
    </div>
  </div>
</template>

<script>
import CycleComponent from "../common/cycleComponent.vue";

export default {
  components: { CycleComponent },
  props: {
    superObj: {
      type: Object,
      default: () => {
        return {
          all: {},
          typeList: [],
        };
      },
    },
  },
  computed: {

  },
  data() {
    return {};
  },
  mounted() {

  },

};
</script>

<style lang="scss" scoped>
.supervision {
  width: 100%;
  height: 100%;
  padding: 10px 0 20px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  .total {
    width: 100%;
    background: rgba(59, 139, 255, 0.1);
    border: 1px solid rgba(59, 139, 255, 0.4);
    border-radius: 4px;
    padding: 8px 0;
  }
  .details {
    flex: 1;
    width: 100%;
    padding: 10px 0;
    overflow: hidden;

    .el-row {
      margin-left: 0 !important;

      width: 100%;
      padding: 6px 0;
      border-bottom: 1px solid rgba(59, 139, 255, 0.4);
    }
  }

  .el-col {
    text-align: left;
  }
  img {
    height: 2.5rem;
    width: 2.5rem;
    vertical-align: middle;
    margin: 0 5px 0 10px;
  }
  .fs-sm {
    font-family: SourceHanSansCN-Regular;
    font-size: 1rem;
    color: #bfd9ff;
    font-weight: 400;
  }
}
</style>
